// EMWiFiTool.h 
// EMWiFiControl 
// 
// Created by HCC on 2018/12/7. 
//  
// 工具类

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#define kScreenHeight  [UIScreen mainScreen].bounds.size.height
#define kScreenWidth   [UIScreen mainScreen].bounds.size.width
#define kStatusHeight  [UIApplication sharedApplication].statusBarFrame.size.height
#define kNavHeight   44
#define kScreenScale  [UIScreen mainScreen].scale
#define kScaleIphone6 [UIScreen mainScreen].currentMode.size.height/[UIScreen mainScreen].scale/667.0
#define kWiFiBundle   [EMWiFiTool bundleWithBundleName:@"EmaxWiFi" podName:@"Emax_WiFiControl"]


static __inline__ double adaptFontSize(double size) {
    return (kScreenScale-2)*2 + size;
}


@interface EMWiFiTool : NSObject

/**
 *  return 手机WiFi是否开启
 */
+ (BOOL)isWiFiOpened;

/**
*  return 手机当前连接的WiFi名称
*/
+ (NSString *)currentSSID;

/**
 *  return 是否合法名称或密码(设备无法识别',','=','?')
 */
+ (BOOL)isLegalKeyString:(NSString *)key;

/**
 *  return 手机当前连接的WiFi地址
 */
+ (NSString *)currentMac;

/**
 *  return 手机ip地址
 */
+ (NSString *)currentIPAddress;

/**
 *   跳转到设置
 */
+ (void)jumpToWifiSettings;

/**
 *   连接WIFI
 */
+ (void)connectToWiFi:(NSString *)ssid pwd:(NSString *)pwd cancleHandle:(void(^)(void))handle;


/**
 *  debug日志开关
 */
+ (void)setLogDebug:(BOOL)debug;


/**
 *  记录1条日志
 */
+ (void)appendLog:(NSString *)format, ... ;

/**
 *  清空日志
 */
+ (void)clearLog;

/**
 *  返回所有日志
 */
+ (NSString *)currentLog;


/**
 *  重新着色UIImage
 *
 */
+ (UIImage *)tintImageWithColor:(UIColor *)tintColor image:(UIImage *)image;

/**
 获取文件所在name，默认情况下podName和bundlename相同，传一个即可
 
 @param bundleName bundle名字，就是在resource_bundles里面的名字
 @param podName pod的名字
 @return bundle
 */
+ (NSBundle *)bundleWithBundleName:(NSString *)bundleName podName:(NSString *)podName;

@end

